import Taro from '@tarojs/taro'
// 有关设备
export function getHeadHeight() {
  let headHeight = 0
  let res = Taro.getSystemInfoSync()
  const { statusBarHeight } = res
  res = Taro.getMenuButtonBoundingClientRect()
  if (res) {
    const { bottom, top } = res
    headHeight = bottom + top - statusBarHeight
    // console.log(headHeight)
  }
  return headHeight
}

export function getHeight() {
  let height = 0
  const res = Taro.getSystemInfoSync()
  const { screenHeight, pixelRatio } = res
  height = screenHeight * pixelRatio
  return height
}
